package restlet;

import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.routing.Router;

public class RestletRouter extends Application {

	/**
	 * Creates a root Restlet that will receive all incoming calls.
	 */
	@Override
	public Restlet createInboundRoot() {
		// Create a router Restlet that routes each call to a
		Router router = new Router(getContext());

		// dva paranetra za logovanje
		router.attach("/user/{username}/{password}", UserServerResource.class);
		// simpleEntity klase, koje ucitavamo samo ako postoji novija verzija na serveru
		router.attach("/places", PlaceResource.class);
		router.attach("/benCats", BenCatsResource.class);
		router.attach("/tripCats", TripCatsResource.class);
		//router.attach("/carrier", CarrierResource.class);
		router.attach("/carrier/{carrierId}", CarrierResource.class);
		router.attach("/beneffit", BeneffitResource.class);
		router.attach("/beneffit/{povlasticaId}", BeneffitResource.class);
		router.attach("/tripParts", TripPartResource.class);
		router.attach("/tripLines", TripLineResource.class);
		router.attach("/versions", VersionResource.class);

		return router;
	}

}
